package com.num2.controller.lkw;

import javax.annotation.Resource;
import javax.servlet.http.HttpSession;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.num2.form.lkw.Deposit_Money;
import com.num2.service.lkw.DepositService;

@Controller
public class DepositCtrl {
	
	@Resource
	private DepositService depositservice;
	@RequestMapping("/deposit")
	public String depositMoney(Deposit_Money dm,HttpSession session,Model m){
			
			boolean result = depositservice.insertMoney(dm,session);
			if(result){
				m.addAttribute("successinfo","存款成功!");
				return "demo/deposit";
			}else{
				m.addAttribute("failinfo","存款失败!金额只能为数字!");
				return "demo/deposit";
			}
		}
	public DepositService getDepositservice() {
		return depositservice;
	}
	public void setDepositservice(DepositService depositservice) {
		this.depositservice = depositservice;
	}
	
	
	
	}

